import { defineStore } from 'pinia'
import { postJobDetailRequest } from '@/service/module/job/jobdetail'

// interface IloginFace{
//     id: number,
//     title:string,
//     path: string,
//     name: string,
//     content:string,
// }

interface Ijobdetaildemo {
  xiid?: number
  siid?: number
  giid?:number
  name: string

  content: string

  title: string

  
  condition: string
}

export const useJobDetailStore = defineStore('jobdetail', {
  state: () => ({
    jobDetailDatas: [] as Ijobdetaildemo[],
    xingzhengDatas:[]as Ijobdetaildemo[],
    shiyeDatas:[]as Ijobdetaildemo[],
    guoqiDatas:[]as Ijobdetaildemo[],

    xiid: 0,

  }),

  actions: {
    //行测技巧列表数据
    async jobDetailResultAction(jobdetail: number) {
      const res = await postJobDetailRequest(jobdetail)
      

        this.xingzhengDatas = res.data.data.findJobDetailData[0].xingzheng
        this.shiyeDatas = res.data.data.findJobDetailData[0].shiye
        this.guoqiDatas = res.data.data.findJobDetailData[0].guoqi

      //   this.guoqiDatas = res.data.data.findJobListData[1].guoqi

      //   this.total = res.data.data.total
      console.log(this.xingzhengDatas, '求职详情页')
    
    },
  },
  persist: true,
})
